﻿@{
    ViewBag.Title = "EditPwd";
    ViewBag.First = "派车系统";
    ViewBag.Second = "修改密码";
    Layout = "~/Views/Shared/_BaseLayout.cshtml";
}
<script type="text/javascript">
    function saveData() {
        var f = $("#txtNewPwd").val();
        var s = $("#txtCNewPwd").val();
        if (f.length <= 0) {
            Tips("请输入新密码！", "txtNewPwd");
            return false;
        }
        if (s.length <= 0) {
            Tips("请再次输入密码！", "txtCNewPwd");
            return false;
        }
        if (f != s) {
            Tips("两次密码不一致！", "txtCNewPwd");
            return false;
        }
        var load = loadTip("正在修改密码，请稍候", 16, 0);
        var url = '@Url.Action("UpdatePwd","Home")';
        $.post(url, { pwd: s }, function (data) {
            if (data > 0) {
                loadTip("密码修改成功", 1, 1000);
            } else {
                loadTip("密码修改失败", 2, 1000);
            }
            layer.close(load);
        });
    }
</script>
<div class="formbody">
    <div class="formtitle"><span>修改密码</span></div>
    <ul class="forminfo">
        <li><label>新密码</label><input type="password" id="txtNewPwd" class="dfinput" /><i></i></li>
        <li><label>确认密码</label><input type="password" id="txtCNewPwd" class="dfinput" /><i></i></li>
        <li><label>&nbsp;</label><input type="button" class="btn" onclick="saveData();" value="确认保存" /></li>
    </ul>
</div>

